<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserBalanceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_balance', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('user_name',50)->default('')->comment('用户名称');
            $table->string('token',20)->default('')->comment('token');
            $table->decimal('amount',20,12)->comment('数量');
            $table->string('type',20)->default('mining')->comment('类型');
            $table->string('type_note',200)->default('')->comment('类型说明');
            $table->string('ticket',200)->default('')->comment('票根');
            $table->text('note')->nullable()->comment('备注');
            $table->tinyInteger('state')->default(1)->comment('状态 1是完全体 0待审核');
            $table->timestamp('add_time')->default(DB::raw('CURRENT_TIMESTAMP'))->comment('添加时间');
        });
    }

    /**
     * Reverse the migrations.
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_balance');
    }
}
